home *** CD-ROM | disk | FTP | other *** search
- Path: aadt.sdt.com!usenet
- From: Larry Baker <leb@sdt.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Will JAVA kill C++?
- Date: Wed, 13 Mar 1996 10:56:33 -0800
- Organization: SABRE Decision Technologies
- Message-ID: <31471A61.3510@sdt.com>
- References: <313E44EA.14D110C0@netcom.com> <4hp18v$3di@frodo.smartlink.net> <4ht8k1$t7l@epx.cis.umn.edu> <3146278D.7703E9CC@netcom.com>
- NNTP-Posting-Host: parmail
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
-
- Adam Megacz wrote:
- > I'm not a Fortran buff, but I don't understand why C is faster
- > than C++. C++ supports all C features (except the void* crap).
- > If anything, C++'s type-checking allows more compiler
- > optimizations, making it a slightly faster language.
-
- If you code _exactly_ the same way using a C++ compiler, in
- essence using the C++ compiler to compile a "C" program, then
- you should see no performance difference on non-optimized code.
-
- C vs Fortran raises a few other interesting comparisons. All variables
- in FORTRAN are the equivalant of C "static" types - they aren't
- dynamically pushed/popped off of the stack, as with automatic C
- variables, or dynamically allocated using malloc/free, as they
- may be (even as automatic, stack-based instances) in C++. Hence
- the C runtime semantics, and moreso the C++ runtime semantics, may
- incur some slight "background" overhead when compared to a much
- simpler language like FORTRAN.
-
- Larry Baker
- leb@sdt.com
-